﻿using System;

namespace Common
{
    public static class CommonHelper
    {
        public static bool IsValidDate(DateTime dateTime)
        {
            return dateTime >= Constant.MinDate && dateTime <= Constant.MaxDate;
        }

        public static DateTime LastDayOfMonth(DateTime date)
        {
            return new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month));
        }

        public static DateTime FirstDayOfMonth(DateTime date)
        {
            return new DateTime(date.Year, date.Month, 1);
        }
    }
}
